<?php
/*
 * Created on Feb 23, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
include('includes/session.php');
$title = '';
include('header.inc');
include('lefter.inc');

$itemId = $_GET['itemid'] ? $_GET['itemid'] : '';
$type = $_GET['type'] ? $_GET['type']  : '';
$item = $cityModel->getItemDetail($itemId); 

// Count increment for each click item detail
$reesNewModel->incrementShow($itemId);	 
?>
<div id="col3">
	<div id="col3_content" class="clearfix"><a id="content" name="content"></a>
		<div class="subcolumns_oldgecko widget_space">
			<div class="widget_margins" style="font-size:11px;">
			<?php if (isset($item)) { ?>
			
			<div style="background-color: #E5EFF6; min-height: 24px; padding-left: 12px; padding-top: 12px;">
				<h2><?php echo '<img src="img/icn_blue.gif" style="margin-right:10px;"/>'.$item['title'] ?></h2>
			</div>
			<table width="100%">
				<tr class="cityRegion">
					<td width="80px">Mô tả</td>
					<td><?php echo $item['description'] ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Nội dung</td>
					<td><?php echo $item['content'] ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Kích thước</td>
					<td><?php echo $item['size'] ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Vị trí</td>
					<?php 
					$cityName = isset($item['city_name']) ? $item['city_name'] : "";
					$districtName = isset($item['district_name']) ? $item['district_name'].' » ' : "";
					$place = isset($item['place']) ? $item['place'].' » ' : "";
					?>
					<td><?php echo $place.$districtName.$cityName ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Giá</td>
					<td><?php echo $item['price'] ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Ngày tạo:</td>
					<td><?php echo ConvertSQLDate($item['createDate']) ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Ngày hết hạn:</td>
					<td><?php echo ConvertSQLDate($item['endDate']) ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Liên hệ:</td>
					<?php $email = isset($item['email']) ? autoLinkEmailAddress($item['email']) : '' ?>
					<td>
						<?php echo '<img src="images/phone.png" height="15" width="15" />&nbsp;<strong>'.$item['contact'] .'</strong>' ?>
						<?php echo '<img src="images/letter.png" style="margin-left:30px;" />'.$email ?>
					</td>
				</tr>
				<tr class="cityRegion">
					<td>Người đăng</td>
					<td><?php echo $item['fullName']; ?></td>
				</tr>
				<tr class="cityRegion">
					<td>Hình ảnh</td>
					<td><?php 
						$fileImage = 'img/upload/item/'.$item['image'];
						if ($item['image'] && file_exists($fileImage)) {
							echo '<img alt="" src="'.$fileImage.'" width="220" height="250" />';
						} else {
							echo '<img alt="" src="img/NoPhotoAvailable.jpg" width="100" height="110" />';
						}
					?></td>
				</tr>
				<tr class="cityRegion"><td colspan="2"></td></tr>
			</table>
			 <br />
			
			<?php 
				// <!-- Cac tin co lien quan -->
				echo '<div style="margin-bottom: 10px;">';
					echo '<p><div class="last-new"><h2>Các tin liên quan</h2></div></p>';
					include_once 'includes/nestatedetail.php'; 
				echo '</div>';
			}
			?>
			
			</div>
		</div>
	</div>
</div>

<?php include('footer.inc'); ?>
